import React, { useContext } from 'react'
// 将父组件的AppContext引入
import { AppContext } from '../App'
import List from './Item/index'

export default function Item() {
    // 用useContext(),共享父组件的car,
    const car2 = useContext(AppContext)
    return (
        <div>
            <h2>我是儿子,我开的是我父亲的{car2}</h2>
            <hr />
            <List/>
        </div>
    )
}
